<!--
	创建者：luyiming
	该文件用于：
	创建时间：2020-03-06 21:47:29
-->
<template>
	<div class="RCIM-licenceDeclaration_view">
		<div class="timmer_wrap">
			<div class="form_wrap">
				<el-date-picker
					v-model="timmer"
					:type="type.precise"
					range-separator="至"
					:format="type.format"
					placeholder="选择日期"
					start-placeholder="开始日期"
					end-placeholder="结束日期"
					@change="changeDate"
					v-if="showTimeLinePiker"
				>
				</el-date-picker>
				<slot name="leftRule"></slot>
			</div>
			<div class="btn_wrap">
				<el-button type="primary" @click="searchLicenceList"
					>查询</el-button
				>
				<el-button type="primary" @click="handleChangeVisible"
					>申报</el-button
				>
			</div>
		</div>
		<Table
			:tableData="tableData"
			:tableHead="tableHead"
			:isUseSlot="false"
			:page="listQuery.page"
			:limit="listQuery.limit"
			v-loading="listLoading"
		>
			<template slot="tool" slot-scope="{ data }">
				<el-button
					style="padding:3px;"
					icon="el-icon-document"
					@click="handleEdit(data.row)"
					type="text"
					>查看</el-button
				>
			</template>
		</Table>
		<Pagination
			v-show="total > 0"
			:total="total"
			:page.sync="listQuery.page"
			:limit.sync="listQuery.limit"
			@pagination="getList"
		></Pagination>
		<el-dialog
			class="licenceDialog"
			:visible.sync="dialogVisible"
			:close-on-click-modal="false"
			@closed="closeDialog"
			:destroy-on-close="true"
			width="50%">
			<div class="content_wrap">
				<h2 class="dialogTitle">辐射安全许可证申报</h2>
				<table width="100%" align="center">
					<tbody>
						<tr>
							<td>企业名称</td>
							<td colspan="3">{{ licenceInfo.name }}</td>
						</tr>
						<tr>
							<td><span style="color: #ff4949;margin-right: 4px;">*</span>单位类型</td>
							<td colspan="3" style="padding: 0;">
								<el-select :disabled="isScan" v-model="licenceInfo.enterpriseType" placeholder="请选择单位类型">
									<el-option
										v-for="item in enterpriseTypeOptions"
										:key="item.value"
										:label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</td>
						</tr>
						<tr>
							<td><span style="color: #ff4949;margin-right: 4px;">*</span>单位状态</td>
							<td colspan="3" style="padding: 0;">
								<el-select :disabled="isScan" v-model="licenceInfo.enterpriseStatus" placeholder="请选择单位状态">
									<el-option
										v-for="item in enterpriseStatusOptions"
										:key="item.value"
										:label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</td>
						</tr>
						<tr>
							<td>登记人</td>
							<td>{{ licenceInfo.registrant }}</td>
							<td>企业负责人</td>
							<td>{{ licenceInfo.chargePerson }}</td>
						</tr>
						<tr>
							<td><span style="color: #ff4949;margin-right: 4px;">*</span>发证日期</td>
							<td colspan="3" style="padding: 0;">
								<el-date-picker
									v-model="licenceInfo.dateOfIssue"
									type="date"
									:disabled="isScan"
									placeholder="选择发证日期">
								</el-date-picker>
							</td>
						</tr>
						<tr>
							<td><span style="color: #ff4949;margin-right: 4px;">*</span>有效日期</td>
							<td colspan="3" style="padding: 0;">
								<el-date-picker
									v-model="licenceInfo.effectiveDate"
									type="date"
									:disabled="isScan"
									placeholder="选择有效日期">
								</el-date-picker>
							</td>
						</tr>
					</tbody>
				</table>
				<!-- <el-button @click="" style="margin:10px 0 0 5px;">添加附件</el-button> -->
				<el-upload
					v-if="!isScan"
					class="upload-demo"
					style="margin:10px 0 0 5px;"
					action="https://jsonplaceholder.typicode.com/posts/"
					ref="uploadFile"
					:on-preview="handlePreview"
					:on-remove="handleRemove"
					:before-remove="beforeRemove"
					:http-request="htpRequest"
					multiple
					:limit="1"
					:on-exceed="handleExceed"
					:file-list="licenceInfo.licenceImgUrls">
					<el-button size="small">添加附件</el-button>
					<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div> -->
				</el-upload>
				<el-image
					class="licenceImg"
					v-for="(item,index) in licenceInfo.licenceImgUrls"
					:key = "index"
					style="width:100px;height:100px;margin: 10px 0 0 5px;"
					:src="item.url"
					:preview-src-list="licenceImgUrls">
				</el-image>
			</div>
			<span slot="footer" class="dialog-footer" v-if="isGO">
				<el-button type="primary" @click="submitLicenceInfo" :disabled="isScan">申 报</el-button>
				<el-button @click="dialogVisible = false">取 消</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
import RcimLicenceDeclaration from './index.js';
export default RcimLicenceDeclaration;
</script>

<style lang="scss" scoped>
@import "./index.scss";

</style>
<style lang="scss">
.RCIM-licenceDeclaration_view {
	.licenceDialog{
		.el-dialog__footer{
			text-align: center !important;
		}

		.el-select ,.el-date-editor{
			width: 100%;

			.el-input__inner{
				width: 100%;
				height: 48px;
				line-height: 48px;
				border: none;
			}
		}
	}
}
</style>
